Skip to content

Conversation

@cau1k
Copy link
Contributor

@cau1k cau1k commented Dec 19, 2025

Opening as a draft because it's not a clean impl (see below).

I've been looking into this as I really like the concept of per-provider configuration of this plugin, but @Tarquinen 's initial conclusion in #77 is spot on. We're able to adjust how the plugin functions at runtime BUT are stuck with the prune tool being loaded into context regardless of whether it's disabled in the plugin config due to opencode's constraints. I did experiment with MessageV2.User.tools but it's unreliable. Remediating this behavior might include a tool hook for tools.enabled, or maybe general provider.tool config in OC (kinda messy/immediate fix).

Example dcp.jsonc

{
  "enabled": true,
  "debug": true,
  "pruningSummary": "detailed",
  "overrides": {
    "provider": {
      "openai": {
        "enabled": true,
        "strategies": {
          "pruneTool": {
            "enabled": false
          },
          "deduplication": {
            "enabled": true
          },
          "supersedeWrites": {
            "enabled": true
          },
          "onIdle": {
            "enabled": true
          }
        }
      },
      "azure": {
        "enabled": false
      },
      "anthropic": {
        "enabled": true,
        "strategies": {
          "pruneTool": {
            "enabled": true,
            "frequency": 10
          },
          "deduplication": {
            "enabled": false
          },
          "supersedeWrites": {
            "enabled": false
          },
          "onIdle": {
            "enabled": false
          }
        }
      }
    }
  },
  "strategies": {
    "deduplication": {
      "enabled": true,
      "protectedTools": [
        "custom_tool_1"
      ]
    },
    "supersedeWrites": {
      "enabled": true
    },
    "pruneTool": {
      "enabled": true,
      "protectedTools": [
        "custom_tool_2"
      ],
      "nudge": {
        "enabled": true,
        "frequency": 5
      }
    },
    "onIdle": {
      "enabled": true,
      "protectedTools": [],
      "showModelErrorToasts": true,
      "strictModelSelection": false
    }
  }
}

@Tarquinen
Copy link
Collaborator

I like the idea, but I think loading the tool into the opencode tool registry just for it to return "don't use this tool" if used is way too hacky and is a permanent performance degradation for any models where it's disabled. Is there maybe a way to do this in a similar way to the opencode config modifications being done to add prune to primary tools so it's not used in subagents? Otherwise, this may need an opencode PR first...

@cau1k
Copy link
Contributor Author

cau1k commented Dec 21, 2025

Yeah this was moreso just a theory especially without any tool-plugin pipeline to hook into. I think this is still worth pursuing so I'll keep this updated if I find an alternative approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants